package fast.calc;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;


public class GearBuffs {

	public boolean landslide_mh = true;
	public boolean landslide_oh = true;
	
	//public boolean legendary_mh = false; // for all 3 stages
	
	public List<GearBuffData> gbd = new ArrayList<GearBuffData>();
	public List<String> sid = Arrays.asList("t14_2pc","t14_4pc","t11_2pc","t11_4pc","t12_2pc","t12_4pc","t13_2pc","t13_4pc","dagger_stage_1_2pc","dagger_stage_2_2pc","dagger_stage_3_2pc");
	
	public List<String> gearBuffs = new ArrayList<String>();
	public List<String> setItems2 = new ArrayList<String>();
	
	public GearBuffs() {
		// Data
		GearBuffData mhws = new GearBuffData();
		mhws.name = "mh_windsong";
		mhws.type = "buff";
		mhws.procs_of = "mh";
		mhws.duration = 12;
		mhws.ppm = 1;
		mhws.proc = new Procs();
		mhws.proc.haste = 500;
		mhws.proc.crit = 500;
		mhws.proc.mastery = 500;
		gbd.add(mhws);
		
		GearBuffData ohws = new GearBuffData();
		ohws.name = "oh_windsong";
		ohws.type = "buff";
		ohws.procs_of = "oh";
		ohws.duration = 12;
		ohws.ppm = 1;
		ohws.proc = new Procs();
		ohws.proc.haste = 500;
		ohws.proc.crit = 500;
		ohws.proc.mastery = 500;
		gbd.add(ohws);
		
		GearBuffData mhds = new GearBuffData();
		mhds.name = "mh_dancing_steel";
		mhds.type = "buff";
		mhds.procs_of = "mh";
		mhds.duration = 12;
		mhds.ppm = 1;
		mhds.proc = new Procs();
		mhds.proc.agi = 1650;
		gbd.add(mhds);
		
		GearBuffData ohds = new GearBuffData();
		ohds.name = "oh_dancing_steel";
		ohds.type = "buff";
		ohds.procs_of = "oh";
		ohds.duration = 12;
		ohds.ppm = 1;
		ohds.proc = new Procs();
		ohds.proc.agi = 1650;
		gbd.add(ohds);
		
		GearBuffData mhl = new GearBuffData();
		mhl.name = "mh_landslide";
		mhl.type = "buff";
		mhl.procs_of = "mh";
		mhl.duration = 12;
		mhl.ppm = 1;
		mhl.proc = new Procs();
		mhl.proc.ap = 1000;
		gbd.add(mhl);
		
		GearBuffData ohl = new GearBuffData();
		ohl.name = "oh_landslide";
		ohl.type = "buff";
		ohl.procs_of = "oh";
		ohl.duration = 12;
		ohl.ppm = 1;
		ohl.proc = new Procs();
		ohl.proc.ap = 1000;
		gbd.add(ohl);
		
		GearBuffData mhh = new GearBuffData();
		mhh.name = "mh_hurricane";
		mhh.type = "buff";
		mhh.procs_of = "mh";
		mhh.duration = 12;
		mhh.ppm = 1;
		mhh.proc = new Procs();
		mhh.proc.haste = 450;
		gbd.add(mhh);
		
		GearBuffData ohh = new GearBuffData();
		ohh.name = "oh_hurricane";
		ohh.type = "buff";
		ohh.procs_of = "oh";
		ohh.duration = 12;
		ohh.ppm = 1;
		ohh.proc = new Procs();
		ohh.proc.haste = 450;
		gbd.add(ohh);
		
		GearBuffData dcb = new GearBuffData();
		dcb.name = "dagger_combat_buff";
		dcb.type = "special";
		gbd.add(dcb);
		
		GearBuffData nk = new GearBuffData();
		nk.name = "no_kaled";
		nk.type = "direct_damage";
		nk.icd = 2;
		nk.procs_of = "mh";
		nk.proc_chance = 0.065;
		gbd.add(nk);
		
		GearBuffData nkh = new GearBuffData();
		nkh.name = "no_kaled_heroic";
		nkh.type = "direct_damage";
		nkh.icd = 2;
		nkh.procs_of = "mh";
		nkh.proc_chance = 0.065;
		gbd.add(nkh);
		
		GearBuffData vos = new GearBuffData();
		vos.name = "vial_of_shadows";
		vos.type = "direct_damage";
		vos.icd = 9;
		vos.procs_of = "both";
		vos.proc_chance = 0.45;
		gbd.add(vos);
		
		GearBuffData vosh = new GearBuffData();
		vosh.name = "vial_of_shadows_heroic";
		vosh.type = "direct_damage";
		vosh.icd = 9;
		vosh.procs_of = "both";
		vosh.proc_chance = 0.45;
		gbd.add(vosh);
		
		GearBuffData voslfr = new GearBuffData();
		voslfr.name = "vial_of_shadows_lfr";
		voslfr.type = "direct_damage";
		voslfr.icd = 9;
		voslfr.procs_of = "both";
		voslfr.proc_chance = 0.45;
		gbd.add(voslfr);
		
		GearBuffData thh = new GearBuffData();
		thh.name = "the_hungerer_heroic";
		thh.type = "buff";
		thh.icd = 45;
		thh.duration = 15;
		thh.procs_of = "both";
		thh.proc = new Procs();
		thh.proc.haste = 1730;
		gbd.add(thh);
		
		GearBuffData sclfr = new GearBuffData();
		sclfr.name = "starcatcher_compass_lfr";
		sclfr.type = "buff";
		sclfr.icd = 115;
		sclfr.duration = 20;
		sclfr.procs_of = "both";
		sclfr.proc_chance = 0.15;
		sclfr.proc = new Procs();
		sclfr.proc.haste = 2573;
		gbd.add(sclfr);
		
		GearBuffData sc = new GearBuffData();
		sc.name = "starcatcher_compass";
		sc.type = "buff";
		sc.icd = 115;
		sc.duration = 20;
		sc.procs_of = "both";
		sc.proc_chance = 0.15;
		sc.proc = new Procs();
		sc.proc.haste = 2904;
		gbd.add(sc);
		
		GearBuffData sch = new GearBuffData();
		sch.name = "starcatcher_compass_heroic";
		sch.type = "buff";
		sch.icd = 115;
		sch.duration = 20;
		sch.procs_of = "both";
		sch.proc_chance = 0.15;
		sch.proc = new Procs();
		sch.proc.haste = 3278;
		gbd.add(sch);
		
		GearBuffData wou = new GearBuffData();
		wou.name = "wrath_of_unchaining";
		wou.type = "buff";
		wou.duration = 10;
		wou.stacks = 10;
		wou.procs_of = "both";
		wou.proc = new Procs();
		wou.proc.agi = 88;
		gbd.add(wou);
		
		GearBuffData wouh = new GearBuffData();
		wouh.name = "wrath_of_unchaining_heroic";
		wouh.type = "buff";
		wouh.duration = 10;
		wouh.stacks = 10;
		wouh.procs_of = "both";
		wouh.proc = new Procs();
		wouh.proc.agi = 99;
		gbd.add(wouh);
		
		GearBuffData woulfr = new GearBuffData();
		woulfr.name = "wrath_of_unchaining_lfr";
		woulfr.type = "buff";
		woulfr.duration = 10;
		woulfr.stacks = 10;
		woulfr.procs_of = "both";
		woulfr.proc = new Procs();
		woulfr.proc.agi = 78;
		gbd.add(woulfr);
		
		GearBuffData mr = new GearBuffData();
		mr.name = "matrix_restabilizer";
		mr.type = "buff";
		mr.icd = 105;
		mr.duration = 30;
		mr.procs_of = "both";
		mr.proc_chance = 0.1;
		mr.proc = new Procs();
		mr.proc.haste = 1624;
		gbd.add(mr);
		
		GearBuffData mrh = new GearBuffData();
		mrh.name = "matrix_restabilizer_heroic";
		mrh.type = "buff";
		mrh.icd = 105;
		mrh.duration = 30;
		mrh.procs_of = "both";
		mrh.proc_chance = 0.1;
		mrh.proc = new Procs();
		mrh.proc.haste = 1834;
		gbd.add(mrh);
		
		GearBuffData ks = new GearBuffData();
		ks.name = "kiroptyric_sigil";
		ks.type = "buff";
		ks.icd = 90;
		ks.duration = 15;
		ks.procs_of = "both";
		ks.proc = new Procs();
		ks.proc.agi = 2290;
		gbd.add(ks);
		
		//Cataclysmic Gladiator's Insignia of Conquest
		GearBuffData cgioc = new GearBuffData();
		cgioc.name = "insignia_of_conquest";
		cgioc.type = "buff";
		cgioc.icd = 55;
		cgioc.duration = 20;
		cgioc.procs_of = "both";
		cgioc.proc_chance = 0.15;
		cgioc.proc = new Procs();
		cgioc.proc.agi = 1452;
		gbd.add(cgioc);
		
		GearBuffData ht = new GearBuffData();
		ht.name = "hawkmasters_talon";
		ht.type = "buff";
		ht.icd = 60;
		ht.duration = 15;
		ht.procs_of = "both";
		ht.proc = new Procs();
		ht.proc.haste = 2822;
		gbd.add(ht);
		
		GearBuffData jbf = new GearBuffData();
		jbf.name = "jade_bandit_figurine";
		jbf.type = "buff";
		jbf.icd = 60;
		jbf.duration = 15;
		jbf.procs_of = "both";
		jbf.proc = new Procs();
		jbf.proc.haste = 3595; // 3184 = lfr, 4059 = heroic, 3595 = normal
		gbd.add(jbf);
		
		GearBuffData jbfh = new GearBuffData();
		jbfh.name = "jade_bandit_figurine_heroic";
		jbfh.type = "buff";
		jbfh.icd = 60;
		jbfh.duration = 15;
		jbfh.procs_of = "both";
		jbfh.proc = new Procs();
		jbfh.proc.haste = 4059; // 3184 = lfr, 4059 = heroic, 3595 = normal
		gbd.add(jbfh);
		
		GearBuffData jbflfr = new GearBuffData();
		jbflfr.name = "jade_bandit_figurine_lfr";
		jbflfr.type = "buff";
		jbflfr.icd = 60;
		jbflfr.duration = 15;
		jbflfr.procs_of = "both";
		jbflfr.proc = new Procs();
		jbflfr.proc.haste = 3184; // 3184 = lfr, 4059 = heroic, 3595 = normal
		gbd.add(jbflfr);
		
		GearBuffData gpa = new GearBuffData();
		gpa.name = "gerps_perfect_arrow";
		gpa.type = "buff";
		gpa.icd = 120;
		gpa.duration = 20;
		gpa.procs_of = "both";
		gpa.proc = new Procs();
		gpa.proc.agi = 3480;
		gbd.add(gpa);
		
		GearBuffData wph = new GearBuffData();
		wph.name = "windswept_pages";
		wph.type = "buff";
		wph.icd = 65;
		wph.duration = 20;
		wph.procs_of = "both";
		wph.proc_chance = 0.15;
		wph.proc = new Procs();
		wph.proc.haste = 2468; // FIXME 3386; verify pls
		gbd.add(wph);
		
		GearBuffData titm = new GearBuffData();
		titm.name = "terror_in_the_mists";
		titm.type = "buff";
		titm.icd = 105;
		titm.duration = 20;
		titm.procs_of = "both";
		titm.proc_chance = 0.15;
		titm.proc = new Procs();
		titm.proc.crit = 6908; // 7796 = heroic, 6908 = normal, 6121 = lfr
		gbd.add(titm);
		
		GearBuffData titmh = new GearBuffData();
		titmh.name = "terror_in_the_mists_heroic";
		titmh.type = "buff";
		titmh.icd = 105;
		titmh.duration = 20;
		titmh.procs_of = "both";
		titmh.proc_chance = 0.15;
		titmh.proc = new Procs();
		titmh.proc.crit = 7796; // 7796 = heroic, 6908 = normal, 6121 = lfr
		gbd.add(titmh);
		
		GearBuffData titmlfr = new GearBuffData();
		titmlfr.name = "terror_in_the_mists_lfr";
		titmlfr.type = "buff";
		titmlfr.icd = 105;
		titmlfr.duration = 20;
		titmlfr.procs_of = "both";
		titmlfr.proc_chance = 0.15;
		titmlfr.proc = new Procs();
		titmlfr.proc.crit = 6121; // 7796 = heroic, 6908 = normal, 6121 = lfr
		gbd.add(titmlfr);
		
		GearBuffData bois = new GearBuffData();
		bois.name = "bottle_of_infinite_stars";
		bois.type = "buff";
		bois.icd = 45;
		bois.duration = 20;
		bois.procs_of = "both";
		bois.proc_chance = 0.15;
		bois.proc = new Procs();
		bois.proc.agi = 3236; // 3653 = heroic, 3236 = normal, 2866 = lfr
		gbd.add(bois);
		
		GearBuffData boish = new GearBuffData();
		boish.name = "bottle_of_infinite_stars_heroic";
		boish.type = "buff";
		boish.icd = 45;
		boish.duration = 20;
		boish.procs_of = "both";
		boish.proc_chance = 0.15;
		boish.proc = new Procs();
		boish.proc.agi = 3653; // 3653 = heroic, 3236 = normal, 2866 = lfr
		gbd.add(boish);
		
		GearBuffData boislfr = new GearBuffData();
		boislfr.name = "bottle_of_infinite_stars_lfr";
		boislfr.type = "buff";
		boislfr.icd = 45;
		boislfr.duration = 20;
		boislfr.procs_of = "both";
		boislfr.proc_chance = 0.15;
		boislfr.proc = new Procs();
		boislfr.proc.agi = 2866; // 3653 = heroic, 3236 = normal, 2866 = lfr
		gbd.add(boislfr);
		
		GearBuffData fst = new GearBuffData();
		fst.name = "flashing_steel_talisman";
		fst.type = "buff";
		fst.icd = 90;
		fst.duration = 15;
		fst.procs_of = "both";
		fst.proc = new Procs();
		fst.proc.agi = 4232; //FIXME: item buggy?
		gbd.add(fst);
		
		GearBuffData rox = new GearBuffData();
		rox.name = "relic_of_xuen";
		rox.type = "buff";
		rox.icd = 55;
		rox.duration = 15;
		rox.procs_of = "both";
		rox.onlyCrit = true;
		rox.proc_chance = 0.2;
		rox.proc = new Procs();
		rox.proc.agi = 3027;
		gbd.add(rox);
		
		GearBuffData sw = new GearBuffData();
		sw.name = "searing_words";
		sw.type = "buff";
		sw.icd = 85;
		sw.duration = 25;
		sw.procs_of = "both";
		sw.onlyCrit = true;
		sw.proc_chance = 0.45;
		sw.proc = new Procs();
		sw.proc.agi = 2468; //  3386; FIXME verify pls
		gbd.add(sw);
		
		GearBuffData cccc = new GearBuffData();
		cccc.name = "corens_cold_chromium_coaster";
		cccc.type = "buff";
		cccc.icd = 45;
		cccc.duration = 10;
		cccc.procs_of = "both";
		cccc.onlyCrit = true;
		cccc.proc_chance = 0.1;
		cccc.proc = new Procs();
		cccc.proc.ap = 10164;
		gbd.add(cccc);
		
		// only eng
		GearBuffData engss = new GearBuffData();
		engss.name = "synapse_springs";
		engss.type = "buff";
		engss.icd = 60;
		engss.duration = 10;
		engss.procs_of = "both";
		engss.proc = new Procs();
		engss.proc.agi = 1920;
		gbd.add(engss);
		
		GearBuffData tailorse = new GearBuffData();
		tailorse.name = "swordguard_embroidery";
		tailorse.type = "buff";
		tailorse.icd = 55;
		tailorse.duration = 15;
		tailorse.procs_of = "both";
		tailorse.proc_chance = 0.15;
		tailorse.proc = new Procs();
		tailorse.proc.ap = 4000;
		gbd.add(tailorse);
		
		GearBuffData herblifeblood = new GearBuffData();
		herblifeblood.name = "lifeblood";
		herblifeblood.type = "buff";
		herblifeblood.icd = 120;
		herblifeblood.duration = 20;
		herblifeblood.procs_of = "both";
		herblifeblood.proc = new Procs();
		herblifeblood.proc.haste = 2880;
		gbd.add(herblifeblood);
	}
	
	public GearBuffData getGearBuffData(String name){
		for(GearBuffData g: gbd){
			if(g.name.equals(name))
				return g;
		}
		//System.out.println("proc not found: " + name);
		return null;
	}
	
	public void setSetItems2(List<String> setItems) {
		setItems2 = setItems;
	}
	
	public void setGearBuffs(List<String> gbs){
		gearBuffs = gbs;
	}
	
	public List<String> getGearBuffs(){
		return gearBuffs;
	}
	
	public List<GearBuffData> getAll(){
		return gbd;
	}
	
	public List<String> getAllSets(){
		return sid;
	}
	
	public boolean has(String name){
		return gearBuffs.contains(name);
	}
	
	public boolean hasSet(String name){
		return setItems2.contains(name);
	}

	public List<String> getSetItems2() {
		return setItems2;
	}
}
